<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%@ include file="../header.jsp"%>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>登陆</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="${path}/resources-front/css/iconfont/iconfont.css" rel="stylesheet"/>
    <link href="${path}/resources-front/css/common.css" rel="stylesheet"/>
    <link href="${path}/resources-front/css/login.css" rel="stylesheet"/>
</head>
<body style="min-width: auto;">
     <div class="login-box" style="float: none; margin: auto;">
         <form action="" method="" id="formId">
             <div class="box-hd">
                 <span class="tit">用户登录</span>
                 <a href="sign-in.html">注册新账号</a>
             </div>
             <label class="txtin-box">
                 <span class="ico user"></span>
                 <input class="txtin" type="text" name="username" placeholder="用户名/手机" />
             </label>
             <label class="txtin-box">
                 <span class="ico pwd"></span>
                 <input class="txtin" type="password" name="password" placeholder="密码" />
             </label>
             <div class="clearfix tool">
                 <label class="check"><input type="checkbox" id="" />自动登录</label>
                 <a class="find" href="">忘记密码？</a>
             </div>
             <input class="tj" type="button" value="登&ensp;录" onclick="userLogin()"/>
             <div class="other-way clearfix">
                 <a class="item first" href="">
                     <img src="${path}/resources-front/img/login/weixin.jpg" alt="" class="ico" />
                     <span class="label">微信</span>
                 </a>
                 <a class="item" href="">
                     <img src="${path}/resources-front/img/login/qq.jpg" alt="" class="ico" />
                     <span class="label">微信</span>
                 </a>
                 <a class="item" href="">
                     <img src="${path}/resources-front/img/login/sina.jpg" alt="" class="ico" />
                     <span class="label">微信</span>
                 </a>
             </div>
         </form>
     </div>
</body>
<script src="${path}/resources-front/js/jquery.js"></script>
<link rel="stylesheet" href="${path}/resources-front/js/icheck/style.css"/>
<script src="${path}/resources-front/js/icheck/icheck.min.js"></script>
<script src="${path}/resources-front/js/global.js"></script>
<script>
    $('.check input').iCheck({
            checkboxClass: 'sty1-checkbox'
        });
    
    function userLogin() {
		$.post(
			'${path}/user/login.shtml',
			$('#formId').serialize(),
			function(jsonObj){
				console.log(jsonObj);
				if (jsonObj.code == 0) {
					mylayer.successMsg(jsonObj.msg);
					var index = parent.layer.getFrameIndex(window.name);
					
                    setTimeout(function() {
                    	// 弹出层
                        parent.layer.close(index);
                     	window.parent.location.reload();// 刷新父页面
                    }, 1000);
				} else {
					mylayer.errorMsg(jsonObj.msg);
				}
			},
			'json'
		);
	}
</script>
</html>